<?php
/**
 * Created by 荣耀电竞.
 * User: 林子彦 <278805354@qq.com>
 * Date: 2018/6/13 0013
 * Time: 10:01
 */
namespace App\Shop\Models;
use App\Base\Models\BaseModel;

/**
 * 购物车
 * Class CartModel
 * @package App\Shop\Models
 */
class  CartModel extends  BaseModel {
    /**
     * 表名
     * @var string
     */
    public $table="shop_cart";
    /**
     * 时间自动
     * @var bool
     */
    public $timestamps=false;
    /**
     * The name of the "created at" column.
     *
     * @var string
     */
    const CREATED_AT = 'create_time';  //修改添加时间字段
    /**
     * The name of the "updated at" column.
     *
     * @var string
     */
    const UPDATED_AT = 'update_time';
    /**
     * 模型的日期字段保存格式。
     */
    protected $dateFormat = 'U';

    /**
     * 关联属性值表
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function value(){
        return $this->hasMany(SpecValueModel::class,"sp_id","id");
    }
}